package com.oa.store.service.impl;

import org.activiti.engine.identity.Group;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.oa.store.dao.ShopDao;
import com.oa.store.model.Shop;
import com.oa.store.service.ShopService;

@Service("shopService")
@Transactional(readOnly = true)
public class ShopServiceImpl implements ShopService {

//	@Autowired
//	private ShopRepository shopRepository;
//	
//	@Override
//	@Transactional
//	public void saveShop(Shop shop) {
//		shopRepository.save(shop);
//	}
//
	
//
//	@Override
//	@Transactional
//	public void updateShop(Shop shop) {
//		shopRepository.save(shop);
//	}
//
//	@Override
//	@Transactional
//	public void deleteShopById(Integer id) {
//		shopRepository.delete(id);
//	}
	@Autowired
	private ShopDao shopDao;

	@Transactional
	public int insertShop(Shop shop) {
		return shopDao.insertShop(shop);
	}
	
	@Transactional(readOnly=true)
	public Shop findShopById(Integer id) {
		return shopDao.findOne(id);
	}

	public Group findInstance(String gid) {
		return shopDao.findInstance(gid);
	}

}
